package com.bjdd.jdy.ui.login;

import com.bjdd.jdy.base.BaseModel;
import com.bjdd.jdy.base.BasePresenter;
import com.bjdd.jdy.base.BaseResult;
import com.bjdd.jdy.base.BaseView;
import com.bjdd.jdy.entity.TokenResult;
import com.bjdd.jdy.entity.User;

import rx.Observable;

/**
 * Created by yukai on 2016/11/12.
 */

public interface LoginContract {
    interface Model extends BaseModel {
        Observable<BaseResult<TokenResult>> getLoginModel(String account, String pwd, String timestamp, String sign);
        Observable<BaseResult<User>> getUserInfo(String token,String userId);
        Observable<BaseResult<String>> getCodeModel(String mobile,String timestamp,String sign);
        Observable<BaseResult<TokenResult>> codeLogin(String mobile,String timestamp,String code,String sign);
    }

    interface View extends BaseView {
        void loginSuccess(User user);
    }

    abstract class Presenter extends BasePresenter<Model,View> {
        public abstract void login(String account,String pwd);
        public abstract void getUserInfo(String token,String userId);
        public abstract void getCode(String mobile);
        public abstract void codeLogin(String mobile,String code);
    }
}
